<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="org.springframework.context.support.ClassPathXmlApplicationContext" %>
<%@ page import="org.springframework.beans.factory.BeanFactory" %>
<%@ page import="DAO.UserDao" %>
<%@ page import="POJO.UserEntity" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<%
    BeanFactory beanFactory = new ClassPathXmlApplicationContext("spring-config.xml");
    UserDao userDao=(UserDao)beanFactory.getBean("userDAO");
    UserEntity userEntity = userDao.queryAllUser().get(0);
    session.setAttribute("user",userEntity);
%>
<h2>Hello World!</h2>
${user.name}
</body>
</html>
